Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a few items for user #1027

Closed
wants to merge 4 commits into from
Closed

Added a few items for user #1027

wants to merge 4 commits into from

Conversation

thekingofspace
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:
Added json formatting. This can be used for Storage that is more readable or for nesting data!

Added primitive shapes mod

Added a check if hex code exists mod

Status

  • Code changes have been tested against the Discord API and the discord.js wrapper, or there are no code changes
  • Documentation has been added/modified, or there is nothing to change (docs/mods.json)

Semantic versioning classification:

  • This PR changes DBM's interface (methods or parameters added to default methods)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

Added canvas primitive shapes

Added check if color exists
Added canvas primitive shapes

Added check if color exists
Added canvas primitive shapes

Added check if color exists
Copy link
Contributor

@OneAndOnlyFinbar OneAndOnlyFinbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still split on all of the data mods. It really seems like you're trying to reinvent the wheel and in a very specific way. If you want to add a more widely useful and simple action it would be like "write data to json path."

Comment on lines +33 to +34
if (isValidHexColorCode(colorCode)) result = true;
else result = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having a separate function to check if its valid isn't necessary if its only used once. You can still separate the regex variable for readability but I would recommend the following snippet of code.

const result = /^#(?:[0-9a-fA-F]{3}){1,2}$/.test(colorCode);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants